#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>

int main() {
	int sockfd, len;
	int value;
	char *pvalue;
	
	sockfd = socket(AF_INET, SOCK_STREAM, 0);
	getsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, &value, &len);
	printf("SO_RCVBUF = %d\n", value);
	getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, &value, &len);
	printf("SO_SNDBUF = %d\n", value);
	getsockopt(sockfd, SOL_SOCKET, SO_RCVLOWAT, &value, &len);
	printf("SO_RCVLOWAT = %d\n", value);
	getsockopt(sockfd, SOL_SOCKET, SO_SNDLOWAT, &value, &len);
	printf("SO_SNDLOWAT = %d\n", value);
	getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &value, &len);
	printf("SO_ERROR= %d\n", value);
	getsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &value, &len);
	printf("SO_BROADCAST= %d\n", value);
	getsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &value, &len);
	printf("SO_KEEPALIVE= %d\n", value);
	getsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &value, &len);
	printf("TCP_NODELAY= %d\n", value);
	
	return 0;
}
